package crypto

import (
	"sort"
	"crypto/sha1"
	"encoding/hex"
)

func BuildSign(data []string) string {
	// 排序
	sort.Strings(data)

	str := ""
	for _, d := range data {
		str += d
	}

	// sha1加密
	c := sha1.New()
	c.Write([]byte(str))
	bytes := c.Sum(nil)
	sign := hex.EncodeToString(bytes)
	return sign
}
